package logic

import (
	"context"
	"wechat/models/mysql"

	"wechat/wechatrpc/internal/svc"
	"wechat/wechatrpc/wechatrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CircleShowLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCircleShowLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CircleShowLogic {
	return &CircleShowLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CircleShowLogic) CircleShow(in *wechatrpc.CircleShowRequest) (*wechatrpc.CircleShowResponse, error) {
	// todo: add your logic here and delete this line
	var hh mysql.Circle
	mysql.DB.Where("id=?", in.Id).Find(&hh)
	return &wechatrpc.CircleShowResponse{
		Context: hh.Context,
		UserId:  int64(hh.UserId),
	}, nil
}
